package com.ljx.springboot003.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Objects;

import lombok.Data;

/**
 * 
 * @TableName employee
 */
@TableName(value ="employee")
@Data
public class Employee implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer eId;

    /**
     * 
     */
    private String eName;

    /**
     * 
     */
    private Integer eAge;

    /**
     * 
     */
    private Integer eSalary;

    /**
     * 
     */
    private Integer eDepart;
    
    @TableField(exist = false)
    private String departName;
    
    // 逻辑删除字段
    @TableLogic
    private Integer is_deleted;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return Objects.equals(eId, employee.eId) && Objects.equals(eName, employee.eName) && Objects.equals(eAge, employee.eAge) && Objects.equals(eSalary, employee.eSalary) && Objects.equals(eDepart, employee.eDepart);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(eId, eName, eAge, eSalary, eDepart);
    }
    
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", eId=").append(eId);
        sb.append(", eName=").append(eName);
        sb.append(", eAge=").append(eAge);
        sb.append(", eSalary=").append(eSalary);
        sb.append(", eDepart=").append(eDepart);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}